package service.impl;

import dao.impl.StudentDaoImpl;
import entity.Student;
import service.StudentService;

import java.util.List;

/*
杨威
2021/9/7
10:49
*/
public class StudentServiceImpl implements StudentService {
    StudentDaoImpl studentDao=new StudentDaoImpl();

    public int addStudentIfo(Student student){
        int insert = studentDao.insert(student);
        return insert;
    }

    public int deleteByStuId(int stuId){
        int delete = studentDao.delete(stuId);
        return delete;
    }

    public int updateByStuId(Student student){
        int update = studentDao.update(student);
        return update;
    }

    public List<Student> selectByStuId(int stuId){
        List<Student> students = studentDao.selectOne(stuId);
        return students;
    }

    public List<Student> showAllStudent(){
        List<Student> students = studentDao.selectAll();
        return students;
    }
}
